import Vue from "vue";
import  Vuex from  "vuex";

Vue.use(Vuex);

const store = new Vuex.Store({
    state: {
        status: null,//登录状态
        user: {},//用户信息
    },
    getters: {},
    mutations: {
        setUser(state,user) {//获取到仓库实例并修改用户登录状态
            state.user = user;//存入用户登录数据
        },
        cancelUser(state) {
            state.user = {};
        }
    },
    actions: {},
    modules: {}
})

export default store;
